package com.emily.test.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.emily.test.mapper.OCompanyNavigationMapper;
import com.emily.test.model.OCompanyNavigation;
import com.emily.test.service.CompanyNavigationService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ：zc
 * @date ：Created in 2019/3/26 12:08
 * @description：
 */
@Service
@Transactional(rollbackFor = {Exception.class})
public class CompanyNavigationServiceImpl implements CompanyNavigationService {
    @Resource
    private OCompanyNavigationMapper oCompanyNavigationMapper;

    @Override
    public List<OCompanyNavigation> getCompanyNavigationList() {
        return null;
    }

    @Override
    public List<OCompanyNavigation> getCompanyNavigationList(Integer id) {
        if (id == null) {
            return oCompanyNavigationMapper.getCompanyNavigationAllList();
        }
        return oCompanyNavigationMapper.getCompanyNavigationList(id);
    }

    @Override
    public void delete(Integer id)throws Exception {
        oCompanyNavigationMapper.delete(id);

    }

    @Override
    public int insert(OCompanyNavigation o) {
        return oCompanyNavigationMapper.insertSelective(o);
    }

    @Override
    public int update(OCompanyNavigation o) {
        return 0;
    }
}
